package pers.xhh.shopapi.common;

/**
 * @description:
 * 统一结果枚举类
 * @author: wei-xhh
 * @create: 2020-09-27
 */
public enum ResultCode {
    /**
     * success:成功
     * error:失败
     *      ->5开头
     *         00->程序发生异常!
     *         01->token出错,请重新登录!
     *         02->用户不存在,请重新登录!
     *      ->3开头用户有关
     *         00->用户不存在
     *         01->用户或密码为空
     *         02->用户不存在或密码错误
     *         03->页数或显示条数为空
     *         04->页数或显示条数不合法
     *         05->注册用户失败,
     *         06->用户已经存在
     *         07->id或state为空
     *         08->id不合法
     *         09->更新用户失败
     *         10->不存在该用户
     *         11->id或rid为空
     *         12->id或rid不合法
     *      ->4开头角色有关
     *         00->不存在该角色
     *      ->6开头权限有关
     *      ->700 请求体数据校验失败
     *      ->8开头attribute
     *         00->sel不合法,可选only,many
     */
    SUCCESS(200, "成功!"),
    SUCCESS1(201, "创建成功"),
    ERROR500(500, "程序发生异常!"),
    ERROR501(501, "token出错,请重新登录!"),
    ERROR300(300, "用户不存在,请重新登录!"),
    ERROR301(301, "用户或密码为空!"),
    ERROR302(302, "用户不存在或密码错误!"),
    ERROR303(303, "页数或显示条数为空!"),
    ERROR304(304, "页数或显示条数不合法!"),
    ERROR305(305, "添加用户失败!"),
    ERROR306(306, "用户已存在!"),
    ERROR307(307, "id或state为空!"),
    ERROR308(308, "id不合法!"),
    ERROR309(309, "更新用户失败!"),
    ERROR310(310, "不存在该用户!"),
    ERROR311(311, "id或rid为空!"),
    ERROR312(312, "id或rid不合法!"),
    ERROR313(313, "修改密码失败!"),
    ERROR314(314, "上传头像失败!"),
    ERROR400(400, "不存在该角色!"),
    ERROR401(401, "用户启用状态关闭!"),
    ERROR402(402, "没有权限查询!"),
    ERROR403(403, "添加用户失败!"),
    ERROR405(405, "角色id错误!"),
    ERROR600(600, "获取列表使用类型错误!"),
    ERROR601(601, "分类列表使用错误!如1,2,3"),
    ERROR602(602, "商品参数有值时attr_id和attr_value不能为空！"),
    ERROR603(603, "该属性不存在!"),
    ERROR800(800, "sel不合法,可选only,many!"),
    ERROR900(900, "微博登录失败"),
    ERROR1001(1001, "添加商品到购物车失败"),
    ERROR1002(1002, "商品id为空或添加数量为空"),
    ERROR1003(1003, "全选或取消全选失败！"),
    ERROR1004(1004, "更新商品失败！"),
    ERROR1100(1100, "添加地址失败！"),
    ERROR1101(1101, "更新地址失败！"),
    ERROR1102(1102, "地址id不合法！"),
    ERROR1103(1103, "删除地址失败！"),
    ERROR1200(1200, "订单提交令牌失效！"),
    ERROR1201(1201, "支付总价格为空！"),
    ERROR1202(1202, "订单号不存在！"),
    ERROR1204(1204, "订单分页参数出错！"),
    ERROR1205(1205, "取消订单失败！"),
    ERROR1206(1206, "创建订单失败！"),
    ERROR1207(1207, "修改订单状态失败！"),
    ERROR1203(1203, "支付价格错误！"),
    ERROR1300(1300, "库存不足！");

    private Integer status;
    private String message;

    ResultCode(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
